﻿/*
 * 
 * 
 * 
 * 
 * 
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using Model;

namespace BLL
{
    public class bll
    {

        #region 项目勘察

        #endregion

        #region 项目评估

        #endregion

        dal dal = new dal();
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="Users_Account"></param>
        /// <param name="Users_Pwd"></param>
        /// <returns></returns>
        public SysUser Login(string Users_Account)
        {
            return dal.Login(Users_Account);
        }

        /// <summary>
        /// 动态绑定左侧导航栏 -- 根节点
        /// </summary>
        /// <param name="RoleId"></param>
        /// <returns></returns>
        public List<SysAuthorityAndRoles> LeftBindingParent(int RoleId)
        {
            return dal.LeftBindingParent(RoleId);
        }
        /// <summary>
        ///  动态绑定左侧导航栏 -- 子节点
        /// </summary>
        /// <param name="parentId"></param>
        /// <returns></returns>
        public List<SysAuthority> LeftBindingSon(int ParentId)
        {
            return dal.LeftBindingSon(ParentId);
        }

        /// <summary>
        ///  项目立项 -- 我的立项/列表页
        /// </summary>
        /// <returns></returns>
        public List<EABasic_Info> CapitalList(int userId)
        {
            return dal.CapitalList(userId);
        }
        /// <summary>
        ///  项目立项 -- 登记立项
        /// </summary>
        /// <returns></returns>
        public int CapitalAdd(EABasic_Info b)
        {
            return dal.CapitalAdd(b);
        }
        /// <summary>
        ///  项目立项 -- 新建借款人/可批量添加
        /// </summary>
        /// <returns></returns>
        public int Loan_Info(EALoan_Info b)
        {
            return dal.Loan_Info(b);
        }


        /// <summary>
        ///  项目勘察 -- 我的勘察/列表页
        /// </summary>
        /// <returns></returns>
        public List<EABasic_Info> exploreList(int userid)
        {
            return dal.exploreList(userid);
        }
        /// <summary>
        ///  项目勘察 -- 开始勘察
        /// </summary>
        /// <param name="projectNumber"></param>
        /// <returns></returns>
        public int startExplore(int projectNumber)
        {
            return dal.startExplore(projectNumber);
        }
        /// <summary>
        ///  项目勘察 -- 区位状况勘察
        /// </summary>
        /// <returns></returns>
        public int LocationAdd(EALocation l)
        {
            return dal.LocationAdd(l);
        }
        public List<EABasic_Info> GetListByDepartmentID(int? id)
        {
            return dal.GetListByDepartment(id);
        }
        /// <summary>
        ///  项目勘察 -- 小区状况勘察
        /// </summary>
        /// <returns></returns>
        public int VillageAdd(EAVillage v)
        {
            return dal.VillageAdd(v);
        }
        /// <summary>
        ///  项目勘察 -- 公共区域状况勘察
        /// </summary>
        /// <returns></returns>
        public int FloorsAdd(Floors f)
        {
            return dal.FloorsAdd(f);
        }
        /// <summary>
        ///  项目勘察 -- 室内状况勘察
        /// </summary>
        /// <returns></returns>
        public int IndoorAdd(EAIndoor i)
        {
            return dal.IndoorAdd(i);
        }
        /// <summary>
        ///  项目勘察 -- 现场照片提供
        /// </summary>
        /// <returns></returns>
        public int PhotoAdd(EAPhoto p)
        {
            return dal.PhotoAdd(p);
        }
        /// <summary>
        ///  项目勘察 -- 添加询价结果
        /// </summary>
        /// <returns></returns>
        public int InquiryAdd(EAInquiry q)
        {
            return dal.InquiryAdd(q);
        }
        /// <summary>
        ///  项目勘察 -- 询价记录
        /// </summary>
        /// <returns></returns>
        public List<EAInquiry> InquiryList(int projectNumber)
        {
            return dal.InquiryList(projectNumber);
        }
        /// <summary>
        ///  项目勘察 -- 勘察详情
        /// </summary>
        /// <returns></returns>
        public EABasic_Info Details(int projectNumber)
        {
            return dal.Details(projectNumber);
        }
        /// <summary>
        /// 项目勘察 --  提交勘察记录
        /// </summary>
        /// <returns></returns>
        public int CommitCapital(int Basic_id)
        {
            return dal.CommitCapital(Basic_id);
        }
        /// <summary>
        ///  项目勘察 -- 项目审核记录
        /// </summary>
        /// <returns></returns>
        public List<EABasic_Info> exploreAuditingList(string stute)
        {
            return dal.exploreAuditingList(stute);
        }
        /// <summary>
        ///  项目勘察/项目评估 -- 勘察详情
        /// </summary>
        /// <returns></returns>
        public EABasic_Info assesserList(int basic_id)  // 项目表
        {
            return dal.assesserList(basic_id);
        }
        public EALocation local(int projectNumber)  // 区位状况勘察
        {
            return dal.local(projectNumber);
        }
        public EAVillage village(int projectNumber)  // 小区状况
        {
            return dal.village(projectNumber);
        }
        public Floors floors(int projectNumber)  // 楼状况
        {
            return dal.floors(projectNumber);
        }
        public EAIndoor Indoor(int projectNumber)  // 室内状况
        {
            return dal.Indoor(projectNumber);
        }


        /// <summary>
        ///  项目评估 -- 我的评估/列表页
        /// </summary>
        /// <returns></returns>
        public List<EABasic_Info> assessList(int userid)
        {
            return dal.assessList(userid);
        }


        /// <summary>
        ///  系统管理 -- 部门列表
        /// </summary>
        /// <returns></returns>
        public List<SysDepartment> deptList()
        {
            return DBHelper.ExecuteObjects<SysDepartment>("select * from SysDepartment");
        }
        /// <summary>
        ///  系统管理 -- 部门添加
        /// </summary>
        /// <param name="dept"></param>
        /// <returns></returns>
        public int deptAdd(SysDepartment dept)
        {
            return DBHelper.ExecuteNonQuery("insert into SysDepartment values('" + dept.department_Name + "','此角色的状态 1为启用 0为停用','1',GETDATE(),'王慧君')");
        }
        /// <summary>
        ///  系统管理 -- 角色列表
        /// </summary>
        /// <returns></returns>
        public List<SysRoles> rolesList()
        {
            return dal.rolesList();
        }
        /// <summary>
        ///  系统管理 -- 角色添加
        /// </summary>
        /// <param name="role"></param>
        /// <returns></returns>
        public int rolesAdd(SysRoles role)
        {
            return dal.rolesAdd(role);
        }
        /// <summary>
        ///  系统管理 -- 用户列表
        /// </summary>
        /// <returns></returns>
        public List<SysUser> userList()
        {
            return dal.userList();
        }
        /// <summary>
        ///  系统管理 -- 用户添加
        /// </summary>
        /// <param name="u"></param>
        /// <returns></returns>
        public int userAdd(SysUser u)
        {
            return dal.userAdd(u);
        }
        /// <summary>
        ///  系统管理 -- 菜单列表
        /// </summary>
        /// <returns></returns>
        public List<SysAuthorityAndRoles> andList()
        {
            return DBHelper.ExecuteObjects<SysAuthorityAndRoles>("");
        }
        /// <summary>
        ///  系统管理 -- 字典表
        /// </summary>
        /// <returns></returns>
        public List<SysDictionary> dictionary()
        {
            return DBHelper.ExecuteObjects<SysDictionary>("");
        }


        /// <summary>
        /// 项目审核  --  审核详情列表页
        /// </summary>
        /// <returns></returns>
        public List<EAAuditing> EAAuditingXQ()
        {
            return dal.EAAuditingXQ();
        }
        /// <summary>
        ///  字典查询
        /// </summary>
        /// <param name="dicType"></param>
        /// <returns></returns>
        public List<SysDictionary> dictionary(string dicType)
        {
            return dal.dictionary(dicType);
        }

    }
}
